package com.yootk.main;

import org.springframework.core.io.*;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
import java.util.Scanner;

public class ResourceDemo {
    public static void main(String[] args) throws Exception { // 该抛就抛
        ResourceLoader loader = new DefaultResourceLoader() ;
        Resource resource = loader.getResource("http://www.yootk.com");
        Scanner scanner = new Scanner(resource.getInputStream()) ;
        scanner.useDelimiter("\n") ;
        while (scanner.hasNext()){
            String data = scanner.next() ;
            System.out.println(data);
        }
        scanner.close();

    }
}